package xddq

import (
	D "websocket_apn/define"
	"websocket_apn/log"
)

// 处理小妖卫道信息
func (xd *XdDriver) CheckRoadDefendInfoData(info D.RoadDefendInfo) {
	log.Infof("小妖卫道-当前第%d关 等级%d 剩余体力%d", info.NowLevel, info.Level, info.Strength)
	if info.NowLevel > 49 {
		return
	}
	//level := proto.ParaIntDataByHexStr(info.Level)
	//if level%10000 == 5 || level%10000 == 10 || level%10000 == 15 {
	//	xd.Send(proto.Get_Cmd_Data(xd.userInfo.PlayerId, proto.S_GUARD_FAIRY_TREE_SET_WEAPON, fmt.Sprintf("08 %s 10 E9 07 10 EB 07 10 EC 07 10 EE 07 10 EF 07 10 F0 07 10 F1 07 10 F2 07 18 %s", xd.UserData.Activity[D.Activity_Guard_Fairy_Tree].ID, info.NowLevel)))
	//	xd.ResetTaskByID(proto.S_GUARD_FAIRY_TREE_ENTER_ACTIVITY)
	//}
	//for _, id := range info.ID {
	//	xd.Send(proto.Get_Cmd_Data(xd.userInfo.PlayerId, proto.S_ROAD_DEFEND_START_BATTLE, fmt.Sprintf("08 %s", xd.UserData.Activity[D.Activity_Road_Defend].ID)))
	//	xd.Send(proto.Get_Cmd_Data(xd.userInfo.PlayerId, proto.S_ROAD_DEFEND_FIGHT_RESULT, fmt.Sprintf("08 %s 10 01 18 E8 07 20 %s 28 %02X 30 DE 07 38 %02X 40 32", xd.UserData.Activity[D.Activity_Road_Defend].ID, id, info.Level+2, info.Strength)))
	//}
	//for _, id := range info.ID {
	//	xd.Send(proto.Get_Cmd_Data(xd.userInfo.PlayerId, proto.S_ROAD_DEFEND_START_BATTLE, fmt.Sprintf("08 %s", xd.UserData.Activity[D.Activity_Road_Defend].ID)))
	//	xd.Send(proto.Get_Cmd_Data(xd.userInfo.PlayerId, proto.S_ROAD_DEFEND_FIGHT_RESULT, fmt.Sprintf("08 %s 10 01 18 E8 07 20 %s 28 %02X 30 DE 07 38 %02X 40 32", xd.UserData.Activity[D.Activity_Road_Defend].ID, id, info.Level+1, info.Strength)))
	//}
	//xd.Send(proto.Get_Cmd_Data(xd.userInfo.PlayerId, proto.S_ROAD_DEFEND_UPDATE_SHOPS_GOODS, fmt.Sprintf("08 %s", xd.UserData.Activity[D.Activity_Road_Defend].ID)))

	//time.Sleep(100 * time.Millisecond)
	//xd.ResetTaskByID(proto.S_ROAD_DEFEND_ENTER_GAME)
}
